using UnityEngine;

public class EnergyItemButton : MonoBehaviour
{
	public new UILabel name;

	public UILabel energyVal;

	private StoreItemsConfig.StoreItem myItem;

	public void Init(StoreItemsConfig.StoreItem item)
	{
		myItem = item;
		UITools.ChangeText(name, item.name);
		UITools.ChangeText(energyVal, item.energyGain.ToString());
	}

	public void OnUseRefill()
	{
		StoreItemsConfig.instance.ApplyItem(myItem.name);
		PlayerInventory.instance.RemoveSingleItem(myItem.name);
		EnergyRefillDialog.instance.ShowOwnedEnergyRefills(true);
	}
}
